<?php
    
    $con = mysqli_connect('localhost','root','123456','goodslist');
    $id = $_GET['id'];

    $sql = "SELECT *  FROM `goods` WHERE `goods_id` = '$id' ";

     $res = mysqli_query($con,$sql);
    if(!$res){
        die("数据库出错" . mysqli_error($con));
    }
    $row = mysqli_fetch_assoc($res);
    // print_r ($row);

    // $arr = json_encode($row,JSON_UNESCAPED_UNICODE);
    // print_r ($arr);
    echo json_encode(array(
        "code" => 1,
        "message" => "获取商品信息成功",
        "list" => $row
    )) 
   
?>